<style>
.site-col .site-tp-li-msg .site-li-foot {
	margin:0 5px;
	border-top:1px solid rgb(231, 231, 235);
	height:40px;
	position:relative
}
.site-col .site-tp-li-msg .site-li-foot a{
	position: relative;
	display: table-cell;
	text-align: center;
	vertical-align: middle;
	color:#999;
	float:left;
	width: 33.3%;
	line-height:40px;
}
</style>
<ul class="nav nav-tabs">
	<li><a href="javascript:;" ng-click="access_json('/wxapp.list/list/');">返回列表</a></li>
	<li class="active"><a href="javascript:;" ng-click="access_json('wxapp.list_tpls/')">DIY布局</a></li>
</ul>
<div class="clearfix table-responsive">
<div class="form-group-title ng-binding">
	使用的模板
</div>
<div class="site-tp-list">
	<div class="site-col tj_item" ng-repeat="item in pagedata.tpls">
		<div class="site-tp-li-msg">
          <div class="site-tp-li-content">
            <div class="site-tp-li-info">
              <em class="site-tp-li-date">{{item.title || '自定义'}}</em>
			</div>
            <div class="site-tp-li-item">
				<div class="site-tp-li-thumb" ng-click="access_json('/wxapp.list/design/id='+item.id)" style="background-image:url('{{tomedia(item.image) || '../core/resource/images/nopic-mobile.png'}}')">
					<div ng-if="item.is_open==1" class="timeshow">使用中</div>
					<div class="cover-dark">
						<div class="selected">
							<i class="fa fa-paper-plane-o"></i>
						</div>
					</div>
				</div>
            </div>
          </div>
		  <div ng-if="item.is_open!=1" class="site-li-foot" style="border-top: 0 solid #fff;">
			<a href="javascript:;" ng-click="post({},'open','id='+item.id)"class="foot-left"><i class="fa fa-rocket"></i> 启用</a>
			<a href="javascript:;" ng-click="access_json('/wxapp.app_page//id='+item.id)"class="foot-left"><i class="fa fa-lemon-o"></i> 子页</a>
			<a href="javascript:;" ng-click="post({},'del','id='+item.id)" class="foot-right"><i class="fa fa-trash-o"></i> 删除</a>
		  </div>
		   <div ng-if="item.is_open==1" class="site-li-foot" style="border-top: 0 solid #fff;">
			<a href="javascript:;" ng-click="access_json('/wxapp.list/design/id='+item.id)" class="foot-left"><i class="fa fa-rocket"></i> 设计</a>
			<a href="javascript:;" ng-click="access_json('/wxapp.app_page//id='+item.id)"class="foot-left"><i class="fa fa-lemon-o"></i> 子页</a>
			<a href="javascript:;" ng-click="post({},'del','id='+item.id)" class="foot-right"><i class="fa fa-trash-o"></i> 删除</a>
		  </div>
		</div>
	</div>
</div>
<div class="form-group-title">
	系统模板
</div>
<div class="form-group">
	<div class="btn-group site-tp-group">
		<a href="" ng-class="{'btn': 1,'active': pagedata.params.group_id == 'all'}" ng-click="pagedata.params.page=1;pagedata.params.group_id='all';pagedata.get_list(1,'all')">全部</a>
		<a href="" ng-repeat="(k,v) in pagedata.groups" ng-class="{'btn': 1,'active': pagedata.params.group_id == k}" ng-click="pagedata.params.page=1;pagedata.params.group_id=k;pagedata.get_list(1,k)">{{v}}</a>
	</div>
</div>
<div class="site-tp-list">
	<div class="site-col tj_item">
		<div class="site-tp-li-msg addsite" style='height:353px'>
			<a href="javascript:;" ng-click="access('add')">
			  <div style="margin:120px 30px 30px;font-size:33px"><i class="fa fa-plus"></i></div>
			  <div style="margin:0px 30px">创建一个空微官网</div>
			</a>
		</div>
	</div>
	<div class="site-col tj_item" ng-repeat="item in pagedata.list">
		<div class="site-tp-li-msg">
          <div class="site-tp-li-content">
            <div class="site-tp-li-info">
              <em class="site-tp-li-date">{{item.title}}</em>
			</div>
            <div class="site-tp-li-item">
				<div class="cover-lock" ng-if="item.buy">
					<div class="lock">
						<a href="" class="btn btn-warning item-build-btn" ng-click="access('buy','type=3&id='+item.id,'account.store')" title="购买">点击购买</a>
					</div>
				</div>
				<div class="site-tp-li-thumb" ng-click="post({},'add','id='+item.id)" style="background-image:url('{{tomedia(item.image)}}')">
					<div class="cover-dark">
						<div class="selected">
							<i class="fa fa-check"></i>
						</div>
					</div>
				</div>
            </div>
          </div>
		</div>
	</div>
</div>
	<!-- 分页导航 -->
	<div ng-include="sys_html('common/page',true)"></div>
</div>
<script>
scope.pagedata.get_list=function(page,type){
	type=type?type:'all';
	scope.pagedata.params=scope.pagedata.params?scope.pagedata.params:{}
	if(type){
		scope.pagedata.params.group_id=type;
	}
	scope.get('core/website.mobile_template/list/page='+page+'&group_id='+type,function(res){		
		res.tpls=scope.pagedata.tpls;
		scope.pagedata.list=res.list;
		scope.pagedata.groups=res.groups;
		scope.$evalAsync();
	});
}
scope.pagedata.get_list(1);
</script>